package cn.com.xyc.service.task;

import javax.mail.internet.MimeMessage;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.scheduling.quartz.QuartzJobBean;

public class DsrwTest extends QuartzJobBean{
   private JavaMailSender mailSender;
	@Override
	protected void executeInternal(JobExecutionContext arg0)
			throws JobExecutionException {
		try {
			MimeMessage mess=mailSender.createMimeMessage();
			MimeMessageHelper mesHelper=new MimeMessageHelper(mess,true,"utf-8");
			mesHelper.setTo("384335255@qq.com");
			mesHelper.setFrom("xyc312319@163.com");
			mesHelper.setSubject("计费提醒");
			mesHelper.setText("<html><head></head><body><a href='http://xyc312319.duapp.com/BOOT/main!home.html'>您今日还未计费！！</a></body></html>",true);
	      	mailSender.send(mess);
		} catch (Exception e) {
			e.printStackTrace();
		}
		
	}
	public void setMailSender(JavaMailSender mailSender) {
		this.mailSender = mailSender;
	}
	

}
